package com.ly.demo.service.impl;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @Author liuyang
 * @Date 2024/5/30 10:21
 **/
@Service
public class RedisService {
    @Resource
    private RedisTemplate<String, String> redisTemplate;

    public void setQrCodeTicket(String ticket,String value) {

    }
    public String getQrCodeTicket(String ticket) {
        return redisTemplate.opsForValue().get("WXAccessToken");
    }

    public void setWXAccessToken(String accessToken, Integer expiresIn) {
        redisTemplate.opsForValue().set("WXAccessToken",accessToken,expiresIn-10,TimeUnit.SECONDS);
    }
}
